package com.hz.house.enums;

import java.util.ArrayList;
import java.util.List;

/**
 *  区域查询条件枚举
 * @author lfw
 *
 */
public enum SearchRegionEnum {

	GAOXIN(147182,"高新区",1),
	TIANFUXIN(147183,"天府新区",1),
	WUHOU(132895,"武侯区",1),
	JINJIANG(132847,"锦江区",1),
	QINGYANG(132864,"青羊区",1),
	JINNIU(132879,"金牛区",1),
	CHENGHUA(132913,"成华区",1),
	SHUANGLIU(133002,"双流区",2),
	WENJIANG(132968,"温江区",2),
	PIDU(133028,"郫都区",2),
	XINDU(132954,"新都区",2),
	LONGQUAN(132929,"龙泉驿区",2),
	GAOXINXI(147184,"高新西区",2),
	QINGBAIJIANG(132942,"青白江区",3),
	XINJINXIAN(133078,"新津县",3),
	DUJIANGYAN(133091,"都江堰市",3),
	JINTANGXIAN(132980,"金堂县",3),
	DAYIXIAN(133044,"大邑县",3),
	PUJIANGXIAN(133065,"蒲江县",3),
	CHONGZHOUSHI(133161,"崇州市",3),
	QIONGLAISHI(133135,"邛崃市",3),
	PENGZHOUSHI(133114,"彭州市",3),
	JIANYANGSHI(147225,"简阳市",3),
	GAOXINDONG(147186,"高新东区",3),
	//CHENGDUZHOUBIAN(147221,"成都周边",3),
	MEISHANSHI(147218,"眉山",4),
	MEISHANSHI_TIANFUXINQU(147248,"眉山天府",4),
	GUANGHANSHI(147237,"广汉",4),
	EMEISHANSHI(147247,"峨眉山",4),
	//SUININGHEDONGXINQU(147246,"遂宁河东新区",4),
	QITA(147222,"其他",4);
	
	
	/*
	 * 眉山、眉山天府新区、广汉、峨眉山、攀枝花、遂宁河东新区、其他
	 */
	
	private int id;
	
	private String name;
	
	private int circle;//圈层
	
	SearchRegionEnum(int id,String name,int circle){
		this.id=id;
		this.name=name;
		this.circle=circle;
	}

	
	/**
	 *  获取圈层的区域
	 * @param circle
	 * @return
	 */
	public static List<SearchRegionEnum> getSearchRegionByCircle(int circle){
		
		List<SearchRegionEnum> cs = new ArrayList<SearchRegionEnum>();
		SearchRegionEnum[] all = SearchRegionEnum.values();
		
		for(SearchRegionEnum s:all) {
			if(s.getCircle()==circle)
				cs.add(s);
		}
		return cs;
		
	}
	
	
	/**
	 *  根据id获取区域
	 * @param id
	 * @return
	 */
	public static SearchRegionEnum getSearchRegionById(int id) {
		SearchRegionEnum[] all = SearchRegionEnum.values();
		for(SearchRegionEnum s:all) {
			if(s.getId()==id)
				return s;
		}
		return null;
	}
	
	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public int getCircle() {
		return circle;
	}
	
	
	
}
